package org.biubiu0002.baiblog.core.controller;

import com.google.common.base.Preconditions;
import org.biubiu0002.baiblog.common.utils.R;
import org.biubiu0002.baiblog.core.annotations.PermissionIgnore;
import org.biubiu0002.baiblog.core.model.vo.req.FeedReqVo;
import org.biubiu0002.baiblog.core.model.vo.res.FeedResVo;
import org.biubiu0002.baiblog.core.service.FeedService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: biubiu0002
 * @Date: 2022/8/2 18:14
 **/
@RestController
@RequestMapping("/feed")
public class FeedController {

    @Resource
    private FeedService feedService;

    @GetMapping("/all")
    @PermissionIgnore
    public R all(FeedReqVo feedReqVo){
        Preconditions.checkArgument(feedReqVo.getType()!=null,"feed类型不能为空");
        FeedResVo feedResVo = feedService.all(feedReqVo);
        return R.ok().put("data",feedResVo);
    }

}
